package com.mobile.business;

import java.util.Collection;

import org.hibernate.LockMode;

import com.mobile.dao.IBaseSpringDAO;

/**
 * 基础业务类，每个具体业务类不需继承此类
 * @author hf
 *
 */
public class BaseBusiness2 {

	public IBaseSpringDAO baseDAO;


	public IBaseSpringDAO getbaseDAO() {
		return baseDAO;
	}

	public void setBaseDAO(IBaseSpringDAO baseDAO) {
		this.baseDAO = baseDAO;
	}

	public void delete(Object entity, LockMode lockMode) {
		// TODO Auto-generated method stub
		baseDAO.delete(entity,lockMode);
	}

	public void delete(Object entity) {
		// TODO Auto-generated method stub
		baseDAO.delete(entity);
	}

	public void delete(String entityName, Object entity, LockMode lockMode) {
		// TODO Auto-generated method stub
		baseDAO.delete(entityName, entity, lockMode);
	}

	public void delete(String entityName, Object entity) {
		// TODO Auto-generated method stub
		baseDAO.delete(entityName, entity);
	}

	public void deleteAll(Collection entities) {
		// TODO Auto-generated method stub
		baseDAO.delete(entities);
	}

	public Object merge(Object entity) {
		// TODO Auto-generated method stub
		return baseDAO.merge(entity);
	}

	public Object merge(String entityName, Object entity) {
		// TODO Auto-generated method stub
		return baseDAO.merge(entityName, entity);
	}

	public String save(Object o) {
		// TODO Auto-generated method stub
		return (String)baseDAO.save(o);
	}

	public String save(String entityName, Object entity) {
		// TODO Auto-generated method stub
		return (String)baseDAO.save(entityName,entity);
	}

	public void saveOrUpdate(Object entity) {
		// TODO Auto-generated method stub
		baseDAO.saveOrUpdate(entity);
	}

	public void saveOrUpdate(String entityName, Object entity) {
		// TODO Auto-generated method stub
		baseDAO.saveOrUpdate(entityName, entity);
	}

	public void saveOrUpdateAll(Collection entities) {
		// TODO Auto-generated method stub
		baseDAO.saveOrUpdateAll(entities);
	}

	public void update(Object entity, LockMode lockMode) {
		// TODO Auto-generated method stub
		baseDAO.update(entity, lockMode);
	}

	public void update(Object entity) {
		// TODO Auto-generated method stub
		baseDAO.update(entity);
	}

	public void update(String entityName, Object entity, LockMode lockMode) {
		// TODO Auto-generated method stub
		baseDAO.update(entityName, entity, lockMode);
	}

	public void update(String entityName, Object entity) {
		// TODO Auto-generated method stub
		baseDAO.update(entityName, entity);
	}
	
}
